Modified mist to accept the timeout as an optional argument and work with it