updated comms handling to track state and prevent endless hangup loops