replaced time.sleep with WaitForSerial() function