fixed error for not receiving a complete string