Error Handling improvement