fix seg fault
add support for millions of connections