added a char check method