Handling more error cases