fix search_keys to collect keyids