fix issue where there may not be a focused window