Multiple connections + non-existent dirs

Added check for non-existent directories.
Added support for multiple concurrent connections.