added character check to the class