added callback support for scoping