Fixes #1170 - PIN issues during upgrade

Fixes #1170
Fixes #1170 - PIN issues during upgrade
Merge pull request #1172 from ATofighi/patch-2

Fixes #1170 - PIN issues during upgrade