modification in Serial communication code