fixed the lock/unlock order

Change-Id: I11367f3603ce779e3eda7fb34744d95e60933aa1