Ive used the compsite rule to differentiate e^cosx to get -sinx(e^cosx) (hope i got that bit right)

I now need to use another rule and my answer to diferentiate:

(1-cosx)e^cosx

the answer i came up with was:

(-(-sinx)e^cosx)+((1-cosx)(-sinxe^cosx)) which i think is completely wrong, can anyone point me in the right direction please?