handle case where curKey was null