fixed app_controller.php so the user type is detected properly