fix broken query for filtering sessions by sensor