fixed another bug caused by some previous changes