updated the model to check for unique name, excluding the record that is being updated