fixing performance issues