States reach a deal with mortgage company