fix expiration date logic