edited main_controller