better type checking for expiration date