passing error to the callback instead of throwing it