added handler for serial errors