support maxgens in run script