fixed addClass and removeClass functions performed on container