fixed session adding and made it work as an object