Fixed demo code behaviour error issue.