added a timeout to the connection