Krishna Answers NonInterference During Gambling FreeWill

Yet Mahabharata happened despite Krishna' s presence in Mahabharat.He could have prevented Mahabharata war . He could have easily stopped the Gambling indulged by Yudhishtir and Duryodhana. He did not. Yet the same Krishna talks about Dharma,among other issues in the Bhagavad Gita.How is Dharma compatible with Gambling,which is regarded as one of the five great Sins?Could not Krishna have saved the Pandavas Kingdoms,the humiliation heaped on Draupadi at the Royal hall where she was stripped in Public , stopped the war by the single act of stopping the Gambling of Yudhishtir and Duryodhana?