auto update related fields