bug fix to check both the low value index and the unique offset index when switching to the same layer.