Updated slidechange handler