don't send empty line and more robust application name match