javascript remove element from array if exists