Working on persistent connection.

David to sort code.