better session retrieval