Key null reference fixed