remove comment
add onExit handler, fix task polling, cleanup