use strstr for substring detection in parsing entity symbol
add logging and fix logical error