making some changes to try to narrow access violations