adding a callback function in the render template function