You have the sense of the test in the if statement on line 42 backwards.
In reply to Re: cached problems by GrandFather in thread cached problems by slurch901