remove exporttodir and use export

remove exporttodir and use export ,add test code