I added a check for properties to be valid.