more correct approach for window focus event