add max and min value check