fixed a performance issue