pulling in snowcron's fix

I implemented different solution, but this appears more correct.