Added timeout and request error exit