use ref instead of reference