fix bug in doRun handler