added handling of id fields definitions during serialising