switch to direct sql