added support for persistent connections