fixed handling optional class attributes