On 29 October 2008, after two failed appeals, he was sentenced to death by the Intermediate People's Court of Ürümqi according to the section of the Chinese criminal code which provides the death penalty for smuggling heroin in quantities of more than 50 grams .