fix user creation function