added lock checks