fixed sorting issues on export functions