add graceful and logging sample