Added if-else to filter blank strings