Update slider code to set value. Add resource maagement.