Fixed small issue with using sessions