handle the empty case in mutate