Bug fix for deletion