check if modified before saving