Fixed bug in repeat