fix: made the version check on updates atomic

(cherry picked from commit 95266f7a08066d1afeda17611bc3dfa011f30d20)