switched order of man.close() and System.exit(0)