Timeout

rebase of #352