update timestamp first