writing updated_at as timestamp and eliminating duplicates