fixed licence lookup by fixing raw sql
Merge pull request #498 from xliiv/fixed-licence-lookup

fixed licence lookup by fixing raw sql