Thank you for all the replies, I fixed the problem by simplifying things a little, the code examples helped :-)