update the init function