was encoding the strings the wrong way