use correct type for mode