Added debug statements for when scope or elements are created