fixed another logic error