Fix an issue that changes wrong gateway entry when items are hidden