Change way to get key window