added stdout.flush() to canport