Check if query fails