fix the index layout