remove local allocation that was overlapping a global variable and add assert