remove dontSync and add disconnect handler