added back int the key and value check