Unlock was in wrong scope: could lead to holding lock and never unlocking.