Fixed setup check in execute_query