Add validation and connectivity code