fix quad code