fix some performance issue