A Multiple State Duration Model with Endogenous Treatment