Noticed the problem myself just when I was taking the screenshot. In the module i was setting the counter to its initial value i had changed the variable from the counter one so when it was tring to increase the counter it must be an undefined variable or something. spent an hour looking at that yesterday cant believe i didnt see it. Anyway solved now i think