Implement timeout.