use IORef to pass Field around