add timeout function (and an example script that times out)