moved serial exception handler to createserial function