$.max return nil when array is empty