remove instance of object from an array