default max to 0 instead of -1