I'm going to answer this instead of erasing the question because I found the same problem on other forums.
Basically that code works. I don't know why it happens sometimes that it doesn't work after a while. Even emptying the cache deson't help solve this.
It really makes no sense to me but I thought that since no one has answered others might benefit from trying to reset their pageload somehow and try it again.
cheers!