validate mode