adjusted UI bit, fixed a potential bug