changed init function to callback in core