fix in class2bin function