Handle terminate status from poller. And better logic for engine loop