Fixed pass-by-value instead of pass-by-reference