Added better sessions handling