fix bug with global key setting