handle errors in a more user-friendly way