fixing type-of-reference