resolved bugs in repeat functions