more work on search mode