Autoupdate

This needs to be tested. Probably it will conflict with some changes made in the upgrade process