A worker who voluntarily leaves one job on the promise of a better-paying one doesn’t lose unemployment benefits if that second job suddenly doesn’t pan out, a New Jersey appeals court ruled on Tuesday.

A three-judge Appellate Division panel, in a published decision in McClain v. Board of Review, overturned the state Department of Labor’s denial of unemployment benefits to a woman who left her job as a teacher at one private school to take a job at another—but then found herself unemployed after the second school rescinded its offer of employment.