Could you replace "ENDIF" by "VSYNC 1"?