added Exception Handling