updated reader to accept variable cache location
improved error reporting for templates