more perf improvements (fixed a caching issue)