Factors associated with the discharge of children from foster care