fix to i_final j_final being None