Added an autoupdate function