fixed AD bug