added locate_template function