add connection checks to sql_queries