fix performance bug