Updated upgrade file to clear cache automatically when upgrading