added fetch routine to query failure cause exception