Fix posisble dom element memory leak