fix silly logic error