fix minor lastKey issue