ui_system: modified code acc to github discussion