Fix performance issue