updated export logic