It can be easier when you post your script when asking for help with it. Otherwise no one can see whats wrong. You get then only advices like "find the bug and fix it".