Fixing by reference issue