fix to prevent deletion of records