Server main loop changes