You don't need the else here.
Also, I'm not super stoked on returning a closed connection.
Can you research just returning the collection and getting it to auto-close on garbage-collection, thus obviating the need for keepAlive