fixing html reference sub elements