try moving export code into controller (temp solution)