class bug fixing