Updated function to export objects