Fixed bug when createUser