set scope routine before