updated title logic