Use global variable instead of hasmapto