Changed erroneous exit in query