update main loop of control flow