Hi bluantinoo!
I had a similar problem and found this thread through your comment of the tutorial the code is based on.
Would you mind to post the whole working code? I tried to follow all your comments but at the end I got confused and couldnt get it work.
Are you using Genesis as well?
Thanks!