Use afterRender instead of setTimeout in the initialize function to print errors.