Fixed the slider disconnect issue

Adjusted code accordingly to fix the broken slider issue.