Removing invalid html parts