some bugs fixed ^_^