fix ERROR: statement is not in batch mode