Finally fixed DOM issues