add common ui function