fixed infinite loop when spill vars