fixing check for empty object when registering shortcuts. clearing the SHORTCUTS variable before registering new shortcuts to avoid duplicated/triplicated key events