Correct code to be more robust. Sometimes the test case fail.