Error handling for multiQuery()