Added Exception Handling.