Add sub function for correct invalid anchors