added some main functions to UserController.php