Updated Error Handling

Update error handling