various hacks to get memory to clear