Even though coconut milk is non-dairy, it is best to only add it at the end of the recipe. If it cooks for a long time, coconut milk can curdle which is not desirable. The curdling often happens due to the stabilizers or gums in many canned coconut milks. If you use an organic one without stabilizers, I still recommend using it at the end.