change function to public in template file