added lock check
work in progress