write the timeout manager and test it