Demi Lovato leaving The X Factor