a few tweaks and added connectivity checks