Added Exception Handling for tasks