fix dangling constraints