right before starting to cut out invalid states