adapt to new aes api