fixed possible performance issue