fixed problem with by-reference parameter