fix global leak bug
add nested each get test and fix bug