handling SIGTERM SIGINT for removing temp file
expiry date calculation fixed