handling errors thoughtfully