fixed switch interrupt and switch send/receive code