Thanks a lot for the hint. I adjusted my script with your code and it is working now!