Use property_exists to prevent PHP warnings