bug fix
fix upgrade script