Change if main index if statement