fixed some bugs with scrollpane and nested elements