fix bug of nested search