fix performance issue