fixed sql in license model