rewrote keyExists()