early exit on error
fix api