be more informative and careful about error conditions