fixed index in order function