add mode decision logic