moved login from controller user create into model