scope function