modified application_controller