Add last run time criteria and fix filter func