Added duration slider function