improve slider play function