fixed small serial write bug