Added slider and fixed a weird bugg caused by the slider