check if connection closed