added localStorage and max and min interval