fixed remote getting destroyed before close message is sent