fix performance issues

fix for performance issues