Fixing strange issue where "delete" statement was being skipped