avoid magic numbers & break on disk full