fixing class bug