implemented remove entity functional