working on graceful exception handling