fix initialization using proper DOM element