Flood protection and endogenous sorting of households the role of credit constraints