Fixing the bad record error