Executing END within IF (sometimes) causes IDE crash