fixed query method in abstract dao