Fix title logic error