Fixed possible hangup race condition that would lead to segfualt with hangups.