Make sure close frame is send in right thread