fix npe in data refactoring