fixing index input values problem