Fix scope to be in lambda