Watir StaleElementReferenceError in form in frame
===

I am merely checking for the existing of an element on the page:

    sleep 5 # for the page load
    form.wait_until_present
    next if form.span(:class => "SSSMSGWARNINGTEXT").exists?

`form` comes from these two lines:

    browser.goto browser.frame(:name => "TargetContent").src
    form = browser.form(:name => "win1")

Both the previous and the current page have `form` present, so I added a sleep to make sure that it had the new page. However, my program still crashes with the error:

    [remote server] resource://fxdriver/modules/web_element_cache.js:5665:in `unknown': Element not found in the cache - perhaps the page has changed since it was looked up (Selenium::WebDriver::Error::StaleElementReferenceError)
	from [remote server] file:///var/folders/80/_bwll9x91h7d6c5dp2d3fbb00000gr/T/webdriver-profile20120724-63693-194o52g/extensions/fxdriver@googlecode.com/components/driver_component.js:5354:in `unknown'
	from [remote server] file:///var/folders/80/_bwll9x91h7d6c5dp2d3fbb00000gr/T/webdriver-profile20120724-63693-194o52g/extensions/fxdriver@googlecode.com/components/driver_component.js:6597:in `unknown'
	from [remote server] file:///var/folders/80/_bwll9x91h7d6c5dp2d3fbb00000gr/T/webdriver-profile20120724-63693-194o52g/extensions/fxdriver@googlecode.com/components/driver_component.js:471:in `unknown'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/response.rb:15:in `initialize'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/common.rb:59:in `new'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/common.rb:59:in `create_response'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:65:in `request'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:598:in `raw_execute'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:576:in `execute'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:542:in `find_element_by'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/search_context.rb:42:in `find_element'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/watir-webdriver-0.6.1/lib/watir-webdriver/locators/element_locator.rb:85:in `find_first_by_multiple'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/watir-webdriver-0.6.1/lib/watir-webdriver/locators/element_locator.rb:32:in `locate'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/watir-webdriver-0.6.1/lib/watir-webdriver/elements/element.rb:384:in `locate'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/watir-webdriver-0.6.1/lib/watir-webdriver/elements/element.rb:362:in `assert_exists'
	from /Users/amosng/.rvm/gems/ruby-1.8.7-p370/gems/watir-webdriver-0.6.1/lib/watir-webdriver/elements/element.rb:37:in `exists?'
	from ./my-script.rb:123:in `foo'

What can possibly make it throw an error when I'm merely interested in knowing whether or not a certain element exists?