improvement to timestamp fixing