Add more error handling logics.