only attempt to close if connection is open
add ul to contain annotations