Modification on AutoAnnotation function