Fixing crash on attachedCallback of an Polymer element