issue #885: revert main loop

issue #885: revert main loop