fix for updating value and max to zero