Moved codes for auto update