fixed bug in that I did not check keys