fix logic error "