fix scope pass by reference