moved expiration header just before printing the template