use maximum instead of max to filter for nil