fix notices related with an incorrect sql query