fix "expected to be a reference, value given" warning