fixed code due to changes in buildingtype