add fetching to avoid over max_clients
add scheme check