small bugfix - looping didn't want to stop