Reduce memory leak #30

Create a new connection only if needed. Creating too many connection
is causing too many threads to be created. This reduces the memory
leak significantly but is not the sole reason for the memory leak.