add hooks into the write barrier
try to run the write barrier on environments that are to be overwritten
fix the use of menv and the write barrier