fix build error #625

cherry-picked #625