Cun was later killed in battle .
Wen rose through the ranks until given a separate command following Huang Chao 's capture of the imperial capital Chang'an in January 881 .
Cun was later killed in battle , but Wen rose through the ranks until given a separate command following Huang Chao 's capture of the imperial capital Chang'an in January 881 .