String index out of bound fixed in getKey method