fix some performance problemes