Parents vs foster parents

Our child was taken on June 17 of last year, (we are about to get her back thankfully), but the foster parents claim they have more right to file on our child then we do. We had her 6 months and 17 days, they had her 6 months and 13 days. Who has the right to claim her?