fixing accidental memory leak in global space