adding check for empty session, #218.