handle similarity in case of empty string