ENDIF is more a compiler directive to tell where the IF-THEN statement block finish. I don't see any problem using it like that... but it might be caused by the Sunday's lack of sleep