some bugs modified