adding more descriptive handling of error