I put the AE Template  inside its own function and remove some imports inside function (Maya 2012 issue...)