Undefined variable in AEFactory