Made connect bash script more potent