Add condition for id fields