fix avi;s function