fixed #2 issue

now search is preserving search string in a local variable