Fix main program logic circuit