Fixed the possible problem of receiving only the length but not the string
Problem that still exists is that the string might be sent in multiple parts.