We'd have to see your code to help you.
a couple of notes to ponder:
does your code take into account that NOTHING is to occur outside the "sub handler {" section that affect program flow?
you can have potentially many separate processes running, so exclusive use of resources can be a problem?
--
Jay "Yohimbe" Thorne, alpha geek for UserFriendly