fix init format
must return <0 if error and 0 otherwise