exits if connection times out
comment out exit if time out
add while loop to attempt repeated connections, is this sensible?