added a method for detailed error message.