Fixed issue with sql statement for retrieving bot list by userid