switch to correct index