adds debug prints to getKey method

best to be removed once we fix the bugs with it