fixed issue with conn closed multiple times