fixing an error in class structure