query works