fixing bug where values are contaminating