improve not found search logic