Fix bug while deleting