fix several UI related bugs