Ensure window id is valid