Added scope for callback and minor costmetic change.