added timeout to HTTP request and to read from state file if the HTTP request fails or timesout