Recode ui.coffee short function and clear bug