added ref for by val or byRef