Fixed bug in ui code.