Updated max setting to account for null check