added time type to max and min