initialize lock if not defined