minor modification to setSession does not work yet