Fix bug in user creation fn