pass by reference issue with using unset