added some exception handling around runStmt