Fix bad performance issue