such a nested function should prevent proper pickling if I am not wrong.