added session mechanism