fixed dangling return in serial.c