Add bus loop and modify some codes