checked main program errors