fix sorting add export functionality