added null check to the builder