add condition for date