Cooking the pumpkin filling before baking it with the pastry will help to thicken it up so that the filling is less likely to leak out when baking.