Added functionality and examples for timeout
Bug fix - must set _state when an error