Fixed an issue where startWith is not overridden

Hi, fixed a little issue where the setting startWith was not being overridden because the var i was explicitly set to start from 0. Corrected by moving the var i after var settings and setting i to setting.startWith as it has already been assigned a value.