pass by ref  bug