Workaround for window selection problem