fixed bugs after dom structure changes