fixed query fetch issue