updated SQL queries to respect rg_lead status col
corrected sql error