fixed remove function