check if objects exists before access a property