removed pass by reference and applied a closing unset