fix bug in close, get elements not keys