added lock feature