main loop is added