Fix the toString bug in class