update runMiscSql() method to handle sql correctly