updated export function.