modfied some bugs