throwing better errors for formats