implement short-circuiting on error