bug fixed for autodef