fixed huge bug in ad3 wrapper