correct the type of i