Adding Exception Handling