Fixed a performance issue