trap TERM signal to cleanup