Finally got generateRandomKey() to return the correct type of value.....
But this is a note that I need to test these functions before closing
userComm for good