Added error handling around timeouts

Change-Id: I4f9524b44ab29192bdf933470b7d109f9c26db2e