fixed crash when serial was incorrectly set