fix export snapshot issue and test cases