fix a huge bug in calling getNextRemove