Added sys.stdout.flush() to show messages with nohup