add event handlers for slider