added RpA reference check macro