added cua and html mode.