add flush() call, might fix the arduino hanging problem