bug with testing if key is already found.