correct typo in function getWindowDisplayIndex