added callback to handle init