ui_browsecourses: modified code according to discussion