Hanlding exceptions when constructing elements