extend the init function