fixed memory allocation problem in exports