fixed a main loop problem that only got messages from engine if there were commands to send