javascript remove object from array if exists