Case statement error

...but I can't see that in the code you posted last.