proper cleanup of persistent connections