adds support for timeout