added a check to see if the expiry date is valid or not