Fixed issues with session