add repeat and restart feature