bug fixes in the removal part