Added var declaration for sessionLogic