How to write an overlay that perform search from within an overlay?