fix cache and templates