handle sessions more gracefully