use hasattr to check of object has id
add break pass