Fixing weird index issue