fix errors with bad previous records