Sort:  

All good now.
I guess I made the change late at night and inserted your code at the wrong place. I was too lazy tired to debug and rolled back before going to sleep, which was the best decision.