using env variable instead of hard coding max