fix title logic