edit condition in walk function