fixed bug in the collection#remove method