cleanup
create an autoClosable lock