Moved scope into lamda, as required by AR 4+.