Why Gandhi ji decided to withdraw the Non-Cooperation Movement?

In February 1922, Chauri Chaura in Gorakhpur, Uttar Pradesh. People were protesting against the British policy and in return police officials fired upon them which leads to death of few individuals. People got agitated and they killed many police officials and burnt the police station. Gandhiji was against any kind of violence so hearing of this incident he called off the Non-Cooperation Movement. He felt that the movement was turning violent in many places which he never approved in any circumstances and Satyagrahi needed to be properly trained before they would be ready for mass struggles. He thought the masses have still not understood his idea of Satyagraha and thus continuing the movement may lead to complete chaos in the country. Also he was apprehended that if his movement becomes a violent one then many innocent lives will be compromised. Hence he ordered to withdraw this movement.