Added support for passing in locals to the template