prevent exception when trying to save object with empty associations