fix the default value for i variable