session logic added