updated db engine to accpet filters on joined tables as well as solve order bug when using together with amount