I have worked around that issue by updating a global struct instead of returning one.