Extinction risk in fragmented habitats