fixed performace bug