making the timeout dependent on the run duration