script: upgrade: try to fix possible error