correct html type detection