Code to check connectivity added