fixed lvalue and rvalue handling