Prevented memory leak when repeating