Small fix on timeout of function