adding session logic