fixed perf issues