add setDuration method