output errors to the proper location in main.go [GH-288]