Changed the Query Logic for logicLink