fixed a suntax error preventing users from registering due to an undefined property of the user model in UserSchema.pre('save')