callback with error instead of throw