added lock debugging