fixed a bug in slider demo