Add timeout functionality.