I think Les was correct. It has something to do with global variables! only thing that makes sense to me... Could probably have also got it to work if I had shell that particular script