changed return value of serialFlush to void