fixed grammar to accept max_length, min_length