fixed bug of getting lock from the
wrong group.