Fix the bug of not unlock before return