incorporated recommendations from mgratton to resolve focus crashes - issue #305