Update main_loop