better errors for debugging