changed setClass definition; seems to fix bug