Server main loop added