fixed error message and fixed another case.