Fixing bug for deleting.