adding title and closing html tag