add null handling to Element builder