the problem is that your code syntax is correct.
there is nothing wrong in the syntax there.
the problem is that the logic you intended (which kixtart can't quess) is not correct.

anyway, good if that was all that was wrong.

for code checking, you could use some coloring editor...
hmm, old postprep had a "block" checker inbuild that would have "reported" the error here.

anyways, once your code grows you will see how important it's to write clean easy to follow code.
that way you yourself can see any problems yourself.

some logging would have helped here too as you would have seen that it never exits this part.
_________________________
!

download KiXnet