fixing bugs...
moved user creation functionality from the view.