fixed perf problems