Add timeout function (experimental)