fix loop macro bug