LoveBehavior: incorrect sql query