fix active window crash with a hack