Modified dom-element's parent property to search entity's main DOM element for the appropriate id before using document.getElementById since the current scene may have a matching element id with that of a loading scene, causing elements to be added to the wrong element.
Added "if(this.stage)" check due to entity not having a stage if it was destroyed in the same game loop.