fix removed keys handling