added optional callback for init