fix NPE when no session exists