Fix a quite stupid bug

The cleaning part wasn't in the right function. Kinda stupid.