Add lock to AppInstance