copy result from reentrant functions to internal variable after doing stuff