Add three functions and it works!