Fixed REPEAT functionality

Fixed repeat functionality