support user-defined timeouts