Type error in cross init function