Modify some code, bug fixed