refactored AutoTimestamp.