move content mismatch check after headers