fix performance issues