Extension of Haff's cooling law in granular flows