Updated Exception Handling Added Testing