added session handling for search