You have to use "actions" and not "functions". I had that same problem before and it worked this way.