fixed bugs with export