added register and logout function to user_controller