fixed problem with open connections.