fix dangling spans