Added key check for search