second attempt with query