added serial exception handler to receive function