need to fix date constriant searches and sorting