added out.flush() to network send thread