Save only if id is valid