how did this ever work? assignment to a const reference returned by a function? probably this wasn't a const reference at the beginning