fixed error with reference class