Delete by key name

add a helper func to judge if it's nil