bug fixing for deletion