add functionality for repeat