removing rogue </p> after </figure>