Remove m2 caching and fix secure env var