updated example to include optional callback constructor parameter