added warnings and errors for queries