wrap scope in a lambda