fixed another logic bug