trying to fix performance issue when typing