fix loop