upgrade scripts  fixes