Attempt to fix loop