move the ONLINE check to the main loop