Fixed: ensure functionality in integrity error of the database