modified create user method and added tests