added helper function to clear expired sessions