fix data-init function