fix serial monitor bugs