new version of session code