correctly handling hangup