Delete function remove bug