added extra condition to onFocus