Fix unlocking bug?

Might be more of a question than a PR, but should this lock release after the migration?