A $main->update(); in a strategic place may help you here. I'd try right before the find.
{NULE} -- http://www.nule.org
In reply to Re: Tk sub calling problem by {NULE} in thread Tk sub calling problem by Bloodelf