fix for pass-by-refs