fix test logic error