'program' arg belongs with m.output, not m.input. Putting a try: ... except: pass...