Thanks for your help. I found a different way to fix it which works fine.