patch some bugs