fix issue where query wouldnt get passed to model