Updated search handler