updated doc on error as last argument