made error messages much more descriptive