bug fixing after making externalKey a String