fixing index issue