fixed performance bug