trying to fix connection end hang