finish html title logic