Fix validate connection to execute query