fixes the remove function