cleanup and setlocalversion