fix a possible performance issue