Trying to fix something breaking the loop