Added timeout functionality for hung requests.