Slight modification to user_controller to handle unit tests