fixed string parsing error if shorter string succeeds longer string
added encryption and changed receiving policy check