fixed version of SimpleSQLProgram