position search fixed, val addition added