fixed wrong order of depth/width queries