Improved the error message to include more details