added ready function and _template tag