Jochen, thanks. That works fine.

Howard, I understand the points that you brought up but what I didn't underdstand was the $servicename. Where is that being declared? Above this script? Thanks