fixing sql in post export