adjusted session code