Fixing the error where it says the record already exists, when it doesn't