changed $i to session

doign this to sync