fixed error message to show the actual error which was thrown