Adding basic timeout functionality.