fixes #7928 retain context for custom search