some linting and better error checking for cache