improving export button behavior, fixes #6